package homework;

import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

public class oneWay {
    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("oneWay_pud_group");
        producer.setNamesrvAddr("localhost:9876");
        producer.start();
        Message message = new Message("oneWay", "ds", "forword".getBytes(StandardCharsets.UTF_8));
        producer.sendOneway(message);
        System.out.println("message_success!");
        producer.shutdown();
    }
}
